import http from '@/http'
import { type MenuType } from './MenuModel.ts'

//查询上级菜单
export const getParentApi = ()=>{
    return http.get("/api/menu/parent")
}

//新增菜单
export const addApi = (param:MenuType)=>{
    return http.post("/api/menu",param)
}

//菜单列表查询
export const getListApi = ()=>{
    return http.get("/api/menu/list")
}

//编辑
export const editApi = (param:MenuType)=>{
    return http.put("/api/menu",param)
}

//删除
export const deleteApi = (menuId:string | number)=>{
    return http.delete(`/api/menu/${menuId}`)
}